#include "shm.hpp"
#include "namedpipe.hpp"
int main()
{
    // 创建共享内存并连接
    Shm shm(pathname, proj_id, Creater);
    char *shmaddr = (char *)shm.Addr();
    // 创建管道
    NamedPipe fifo(path, Creater);
    fifo.OpenforRead();

    while (true)
    {
        //读共享内存前先获取唤醒信号
        std::string str;
        fifo.ReadNamedPipe(&str);

        std::cout << "shm content:" << shmaddr << std::endl;
        sleep(1);
    }

    sleep(10);
    return 0;
}